<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>任务中心</title>
    <script type="text/javascript" src="/js/jquery.js"></script>
</head>
<body>

<ul id = "J_list">


</ul>

<script>
    var page = 1;
    var rows = 10;
    $(function(){
        getTaskList();
    });

    function getTaskList(){
        var data = {page:page,rows:rows};
        var url = "/task/task_list";
        $.ajax({
            type: "POST",
            dataType: 'json',
            async: false,
            contentType: "application/json; charset=utf-8",
            data: JSON.stringify(data),
            url: url,
            success: function(res){
                if(res.code = "200"){
                    //操作
                    var list = res.data.list;
                    console.log(list);
                    for (var i=0;i<list.length;i++){
                       var shtml = '<li><div>'+list[i]['dd']+'/ '+list[i]['mm']+'月</div><div>【'+list[i]['class_name']+'】 '+list[i]['title']+'</div>\n' +
                                 '<div>时限 :'+list[i]['start_time']+'--'+ list[i]['end_time'] +'</div>\n' +
                                 '<div>已发放'+(list[i]['read']*list[i]['point'])+'积分     '+list[i]['point']+'积分/阅读</div></li>';
                       $("#J_list").append(shtml);
                    }
                }else{
                    alert(res.msg);
                }
            },
            error: function(e){

            },
            complete: function(e){
            }
        });

    }
</script>

</body>
</html>
